package com.coolwen.service;

import com.coolwen.dao.UserMapper;
import com.coolwen.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by user on 2016-12-4.
 */
@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public User findUserByID(Integer userId) {
        return userMapper.selectByPrimaryKey(userId);
    }

    @Override
    public User findUserByUserName(String userName) {
        return userMapper.selectByUserName(userName);
    }

    @Override
    public int addUser(User user) {
        return userMapper.insertSelective(user);
    }


}
